package com.Bank;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

public class User {                            //用户类User
    private Set<Integer> set = new TreeSet<Integer>();  //私有的成员变量——卡号
    private String name;                                //私有的成员变量 姓名
    private String miMa;                                //私有的成员变量 密码
    private double yuE;                                 //私有的成员变量 余额

    public User(int cardNum, String name, String miMa) {
        this.set.add(cardNum);
        this.name = name;
        this.miMa = miMa;
        this.yuE = 0;
    }

    public boolean hasNum(int CardNum) {
        Iterator<Integer> iter = set.iterator();
        while (iter.hasNext()) {
            int in = iter.next();
            if (in == CardNum) {
                return true;
            }
        }
        return false;
    }

    public void setCardNum(int cardNum) {
        this.set.add(cardNum);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMiMa() {
        return miMa;
    }

    public void setMiMa(String miMa) {
        this.miMa = miMa;
    }

    public double getYuE() {
        return yuE;
    }

    public void setYuE(double yuE) {
        this.yuE += yuE;
    }

    public void setYuE2(double yuE) {
        this.yuE += yuE;
    }
}